<?php
/*
Primary Author: Alex Arey 
Secondary: Derek Shue
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Internship Application (Administrator) form 
is used by Administrators to forward Internship Applications to Community Partners
*/
class Application_Form_InternAppAdmin extends Zend_Form
{
	
    public function init()
    {
    $this->setMethod('post');		
	
	$this->addElement('MultiCheckbox','SUGGESTIONS',array(
		'label'=>'Suggest to the following Community Partners: (ignored if application denied)',
		'MultiOptions' => $this->getPositions(),
		)
	);
	
/*	$this->addElement('MultiCheckbox','ACCEPT',array(
		'label'=>'Deny Application',
		'MultiOptions'=> array('n'=>'Deny'),
		'separator'=>"&nbsp;&nbsp;",
		)
	);
*/
	$this->addElement('submit','submit',array(
	    'label' => 'Submit',
		)
	);
	}
	
	private function getPositions(){
		$internmodel = new Application_Model_InternshipQuery();
		$dbtOrgs = new Application_Model_DbTable_Organizations();
		$internships = $internmodel->getInternships_Student();
		$positionOptionsArray = array();
		foreach($internships as $i){
			$org = $dbtOrgs->getOrganization('ID = '.$i['CPID']);
			$orgname = $org['NAME'];
			$positionOptionsArray[$i['POSID']]=$orgname."-".$i['NAME'];
		}	
		return $positionOptionsArray;
	}


}

